package com.qiandw.common.result;

import lombok.Data;

import java.util.Map;

/**
 * 响应结果
 *
 * @author KG
 */
@Data
public class Response {
    /**
     * 描述信息
     */
    private String msg;
    /**
     * 描述代码
     */
    private String msgCode;
    /**
     * 返回结果
     */
    private Object data;
    /**
     * 错误详情
     */
    private String errorDetail;

    public Response() {
    }

    public Response(Map<String, String> msgMap, Object data, String errorDetail) {
        for (String key : msgMap.keySet()) {
            this.msgCode = key;
            this.msg = msgMap.get(key);
        }
        this.data = data;
        this.errorDetail = errorDetail;
    }
}
